Skip to content

Add GitHub Actions workflows for CI and npm publishing#5

Merged
w01fgang merged 2 commits intomainfrom
add-github-actions
Jun 22, 2025
Merged

Add GitHub Actions workflows for CI and npm publishing#5
w01fgang merged 2 commits intomainfrom
add-github-actions

Conversation

@w01fgang
Copy link
Copy Markdown
Contributor

@w01fgang w01fgang commented Jun 22, 2025

This PR adds two GitHub Actions workflows:

🔄 CI Workflow

  • Runs on every push to main and pull requests
  • Executes type checking, tests, and builds
  • Tests against Node.js versions 18.x, 20.x, and 22.x
  • Uses npm caching for faster builds

📦 Publish Workflow

  • Triggers on GitHub release creation
  • Automatically publishes the package to npm
  • Includes test run before publishing
  • Uses NPM_TOKEN secret for authentication

Benefits

  • Ensures code quality with automated checks
  • Streamlines the release process
  • Provides confidence in multi-version Node.js compatibility
  • Follows best practices for npm package publishing

Ready to merge once CI passes! 🚀

Summary by CodeRabbit

  • Chores
    • Added automated CI workflow to run type checks, tests, and builds on multiple Node.js versions for pushes and pull requests targeting the main branch.
    • Removed the "vite" development dependency from the project configuration.

- Add CI workflow that runs tests, type checking, and builds on push/PR
- Add publishing workflow that publishes to npm on release creation
- CI workflow tests against Node.js 18.x, 20.x, and 22.x
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 22, 2025

Walkthrough

A new GitHub Actions workflow file named ci.yml was added to automate continuous integration. The workflow triggers on pushes and pull requests to the main branch, running tests and builds across Node.js versions 18.x, 20.x, and 22.x using a matrix strategy. Additionally, the vite dependency was removed from the devDependencies in package.json.

Changes

File(s) Change Summary
.github/workflows/ci.yml Added a CI workflow for Node.js projects: triggers on push/PR to main, runs tests/builds on Node 18.x, 20.x, 22.x
package.json Removed vite dependency version ^5.4.19 from devDependencies

Sequence Diagram(s)

sequenceDiagram
    participant GitHub
    participant Runner
    participant Node.js Matrix

    GitHub->>Runner: Trigger workflow on push/PR to main
    Runner->>Node.js Matrix: Start jobs for 18.x, 20.x, 22.x
    Node.js Matrix->>Runner: Checkout code
    Node.js Matrix->>Runner: Setup Node.js version
    Node.js Matrix->>Runner: Install dependencies (npm ci)
    Node.js Matrix->>Runner: TypeScript type check
    Node.js Matrix->>Runner: Run tests (npm run test:run)
    Node.js Matrix->>Runner: Build project (npm run build)
    Runner->>GitHub: Report job results
Loading

Poem

In the warren of code, a new flow appears,
With Node in three flavors, it conquers our fears.
On pushes and pulls, the tests swiftly run,
Type checks and builds—oh, what fun!
The vite hops away, no longer in sight,
Our CI shines bright, a pure delight.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between 7cc6c75 and 09ae76f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json (0 hunks)
💤 Files with no reviewable changes (1)
  • package.json

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

35-37: Build Step Formatting Nitpick
The build command is correct, but there’s trailing whitespace at the end of the line. Please remove the extra space.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between 622edb9 and 7cc6c75.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
🔇 Additional comments (8)
.github/workflows/ci.yml (8)

1-2: Workflow Name is Clear
The name: CI is concise and accurately reflects the workflow’s purpose.


3-8: Trigger Configuration Looks Good
The push and pull_request triggers on the main branch align perfectly with the CI requirements.


9-16: Matrix Strategy Usage is Correct
Testing against Node.js versions [18.x, 20.x, 22.x] ensures multi-version compatibility as intended.


17-25: Checkout and Node Setup
Using actions/checkout@v3 along with actions/setup-node@v3 and built-in npm caching is an effective configuration for reliable, sped-up installs.


26-28: Dependency Installation Step
npm ci guarantees a clean, reproducible install based on your lockfile.


29-31: Type Checking Step
Running npx tsc --noEmit adds useful static type validation without producing build artifacts.


32-34: Test Execution Step
npm run test:run should invoke your test suite. Ensure this script exists in package.json.

#!/bin/bash
# Verify 'test:run' script is defined in package.json
jq -e '.scripts["test:run"]' package.json

1-37: Publish Workflow Missing
The PR objectives reference adding an npm Publish workflow, but no corresponding .github/workflows/publish.yml is included. Please add the publish workflow before merging.

#!/bin/bash
# List all workflow files to confirm publish workflow presence
ls .github/workflows

Signed-off-by: w01fgang <sumin@unix-center.ru>
@w01fgang w01fgang merged commit 845ae1f into main Jun 22, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant